home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c
- Subject: Re: Is it possible to have one Makefile for several compilers?
- Date: 21 Feb 1996 14:10:44 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4gf954$ad@hpbblb.bbn.hp.com>
- References: <31249363.1664@ivab.se>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:31249363.1664@ivab.se
-
- Goran Wireen <Goran_Wireen@ivab.se> wrote:
- >I would like to use the same Makefile for different compilers
- >(Gnu C/C++, Unix cc, CXX). I was hoping that I easily could
- >select compiler by calling e.g:
- >
- > make gcc all
- >
- >and by using a Makefile that looks something like this:
- >
- > # Default compiler is cc
- > CC = cc
- >
- > cxx:
- > CC = cxx
- >
- > gcc:
- > CC = gcc
- >
- > all:
- > $(CC) $(CFLAGS_AND_STUFF) $(SOURCES) ...
- >...
- Delete the targets cxx: and gcc: from your makefile, then you can call
- it with:
- make CC=gcc all
-
- Good luck,
- Matthias
-
-